package com.xbongbong.saas.service;

import com.xbongbong.paas.pojo.dto.FormDataAddDTO;
import com.xbongbong.paas.pojo.dto.FormDataAddGetDTO;
import com.xbongbong.paas.toolbox.exception.XbbException;
import com.xbongbong.pro.draft.pojo.dto.DraftDeleteDTO;
import com.xbongbong.pro.draft.pojo.dto.DraftGetDTO;
import com.xbongbong.pro.draft.pojo.dto.DraftSaveDTO;
import com.xbongbong.pro.draft.pojo.vo.DraftDeleteVO;
import com.xbongbong.pro.draft.pojo.vo.DraftExistVO;
import com.xbongbong.pro.draft.pojo.vo.DraftGetVO;
import com.xbongbong.pro.draft.pojo.vo.DraftSaveVO;

/**
 * 表单草稿Service层
 *
 * @author GuoJun.HU
 * @date 2019/2/20 9:50
 * @since V1.0
 */
public interface FormDataDraftService {

    /**
     * 保存草稿
     *
     * @param draftSaveDTO 保存草稿的数据
     * @return DraftSaveVO
     * @throws XbbException XbbException
     * @author GuoJun.HU
     * @date 2019/2/20 10:02
     * @since V1.0
     */
    DraftSaveVO save(DraftSaveDTO draftSaveDTO) throws XbbException;

    /**
     * 获取草稿
     *
     * @param draftGetDTO 获取草稿的参数
     * @return DraftGetVO
     * @throws XbbException XbbException
     * @author GuoJun.HU
     * @date 2019/2/20 10:04
     * @since V1.0
     */
    DraftGetVO get(DraftGetDTO draftGetDTO) throws XbbException;

    /**
     * 删除草稿
     *
     * @param draftDeleteDTO 删除草稿的参数
     * @return DraftDeleteVO
     * @throws XbbException XbbException
     * @author GuoJun.HU
     * @date 2019/2/20 10:05
     * @since V1.0
     */
    DraftDeleteVO delete(DraftDeleteDTO draftDeleteDTO) throws XbbException;

    /**
     * 新建表单时判断是否有草稿
     *
     * @param formDataAddGetDTO 新建表单数据
     * @return DraftExistVO
     * @throws XbbException XbbException
     * @author GuoJun.HU
     * @date 2019/2/20 15:43
     * @since V1.0
     */
    DraftExistVO exist(FormDataAddGetDTO formDataAddGetDTO) throws XbbException;

    /**
     * 新建表单保存成功后删除草稿
     *
     * @param formDataAddDTO 新建传参
     * @throws XbbException XbbException
     * @author GuoJun.HU
     * @date 2019/2/21 10:18
     * @since V1.0
     */
    void deleteAfterSave(FormDataAddDTO formDataAddDTO) throws XbbException;
}
